import { createApp } from 'vue'
import App from '@/App.vue'

// --------------- svg插件需要配置代码
import 'virtual:svg-icons-register'

// --------------- 样式
import '@/styles/index.scss'

// --------------- element-plus插件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// element-plus国际化
import zhCn from 'element-plus/es/locale/lang/zh-cn'

//暗黑模式需要的样式
import 'element-plus/theme-chalk/dark/css-vars.css'

import router from './router'
const app = createApp(App)
// 安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn,
})
// console.log(router)
app.use(router)
// --------------- 挂载全局组件
import globalComponent from '@/components'
app.use(globalComponent)

// --------------- 大菠萝pinia
import pinia from '@/store/store'
app.use(pinia)

// --------------- 挂载全局方法
// import publicApi from '@/utils'
// app.use(publicApi)

// 获取当前环境变量
// console.log(import.meta.env);
console.log(app)

// 路由守卫
import './permission'

//引入自定义指令文件
import { isHasButton } from '@/directive/has'
isHasButton(app)

app.mount('#app')
